<?php
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false ) {
	$data = require_once __DIR__ . "/data.php";
	require_once __DIR__ . "/include.php";
}else{
	exit('404');
} 
$qid = isset($_GET['qid'])?trim($_GET['qid']):'';
$suc = isset($_GET['suc'])?trim($_GET['suc']):0;
$token = isset($_GET['token'])?trim($_GET['token']):'';
require_once __DIR__ . "/qwarr.php";
$back_url = $data['back_url'];
$back_url2 = $data['back_url2'];
$date = date('Y-m-d',time());
$domainArr = explode('.',$_SERVER['HTTP_HOST']);
$short_redirect = $domainArr[1].'.'.$domainArr[2];
if($short_redirect==$data['d4']){
	$newUrl = "http://".$domainArr[0].".{$data['d2']}/arED/b/{$qid}/s/{$suc}/show.html?token={$token}";
	header("location:$newUrl");exit;
}
//http://yushi.yulingxx.net.cn/p8y/a/0/Cv2a.html?suc=1
$currentUrl = urlencode("http://{$_SERVER['HTTP_HOST']}/arED/b/{$qid}/s/{$suc}/show.html?token={$token}");
$currentUrl_2 = "http://{$_SERVER['HTTP_HOST']}/arED/b/{$qid}/s/{$suc}/show.html?token={$token}";
$index_url = "http://{$data['d1']}/;cq100?_rad=".mt_rand(10000,99999);
$timestamp = time();
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
	<meta http-equiv="Expires" content="0">
	<meta http-equiv="Pragma" content="no-cache">
	<meta http-equiv="Cache-control" content="no-cache">
	<meta http-equiv="Cache" content="no-cache">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <script src="http://zoeyjhqj.oss-cn-beijing.aliyuncs.com/mry/js/limit.js"></script>
	<title>准的吓人!我算的下半年字：<?php echo $qname;?><?php echo randFace();?></title>
    <script type="text/javascript" src="http://cq4rzhstatic.oss-cn-beijing.aliyuncs.com/js/jquery.min.js"></script>
    <script type="text/javascript" src="http://cq4rzhstatic.oss-cn-beijing.aliyuncs.com/js/jweixin-1.1.0.js"></script>
    <link href="http://cq4rzhstatic.oss-cn-beijing.aliyuncs.com/css/main.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="http://cq4rzhstatic.oss-cn-beijing.aliyuncs.com/css/weui.css">
    <style>
    .button {
        display: inline-block;
        outline: none;
        cursor: pointer;
        text-align: center;
        text-decoration: none;
        font: 16px/100% 'Microsoft yahei', Arial, Helvetica, sans-serif;
        padding: .5em 2em .55em;
        text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
        box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    }    
    .orange {
        color: #fef4e9;
        background: #f78d1d;
        border: solid 1px #da7c0c;
    }    
    .bigrounded {
        -webkit-border-radius: 2em;
    }
     @keyframes change {
        0%{ text-shadow: 0 0 4px #f00}
        50%{ text-shadow: 0 0 40px #f00}
        100%{ text-shadow: 0 0 4px #f00}
    }
    </style>
</head>
<body>
	<div style="height:40px; line-height:40px; background:#fff; border-bottom: 1px solid #e2e2e2; "><a href="javascript:void(0)" onclick="jp()" style="background:url(https://qqpublic.qpic.cn/qq_public/0/0-3041344594-25C91C14935F5DB59A6A42DE11E2E00F/0) no-repeat left; background-size: 12px auto; padding-left:20px; margin-left:10px; color: #666;text-decoration: none;" >返回<span style="float: right;margin-right: 10px;">Х关闭</span></a > </div>    <div id="zhu">
        <h1 style="font-size:22px;">我抽到的下半年字：<?php echo $qname;?></h1>
        <p><a href="<?php echo $index_url;?>" style="color: #a2a9b6;"><?php echo $date;?> &nbsp; <span style="animation:change 1s ease-in infinite;font-size:17px;color:#550;">👉恭请圣签请点这里哦👈</span></a></p>
        <div>
		<div style="display:none;"><?php echo $timestamp;?></div> 
            <span><strong><span style="font-size: 14px; ">
<span style="max-width: 100%; color: rgb(227, 108, 9);">
<img src="http://qqpublic.qpic.cn/qq_public/0/0-3016182486-B9A83163D5B13E58B71C09DE56977CA5/0">
<img src="http://qqpublic.qpic.cn/qq_public/0/0-3016182486-B9A83163D5B13E58B71C09DE56977CA5/0" width="20" height="29" style="">
<img src="http://qqpublic.qpic.cn/qq_public/0/0-3016182486-B9A83163D5B13E58B71C09DE56977CA5/0" width="20" height="29" style="">点击上方“</span><span style="max-width: 100%; color: rgb(0, 176, 240); ">闪动文字</span><span style="max-width: 100%; color: rgb(227, 108, 9); ">”免费抽取下半年字。查看你的运势！包你时来运转！</span></span>
            </strong>
            </span>
        </div>
        <hr />
        <img src="<?php echo $qimg;?>" class="qian">
        <div style="text-align:center;"><h2>我抽到的下半年字:<?php echo $qname;?></h2><hr /></div>
        <br />
        <br />
<style>
    #cover {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background:#c5944f;
        display: none;
        z-index: 999;
    }    
    #cover img {
        position: fixed;
        right: 0;
        top: 0;
        width: 100%;
        height: auto;
        z-index: 999;
    }
</style>
<div id="cover" style="display: none;"><img src="https://qqpublic.qpic.cn/qq_public/0/0-2394469424-3BFC037B68DF56C5A337BF0573575514/0"></div>
<div id="zhezhao_share" class="modal" style="display:none;">
    <p style="text-align: right; padding-left: 10px;color:#fff;font-size:20px">
        <img src="https://qqpublic.qpic.cn/qq_public/0/0-2459247859-B75728AFCB94E366B81508645E658A9C/0?fmt=png&size=14&rs=7-7&h=500&w=550&ppv=1" id="share-wx-img" style="width: 100%; padding-right: 15px;">
    </p>
</div>
<div class="weui-dialog" style="display:none;"  id="dialog_alert" >
    <div class="weui-dialog__hd"><strong class="weui-dialog__title">温馨提示</strong></div>
    <div class="weui-dialog__bd" id="dialog_alert_Mes"></div>
    <div class="weui-dialog__ft">
        <a onclick="dialog_alert_Hide();" class="weui-dialog__btn weui-dialog__btn_primary">好</a>
    </div>
</div>
<script language="javascript">
function dowxshare(){
	location.href = "<?php echo $index_url;?>";
}
    function dialog_alert_Hide(){
        $("#dialog_alert").hide();
    }
    function dialog_alert_Mes(mes){
        SDV();
        $("#dialog_alert_Mes").html(mes);
        $("#dialog_alert").show();
    }
    function show_tip(){
        dialog_alert_Mes('<span style="font-size: 20px;color: #f5294c">恭喜您！求到了上上签！</span><br />分享到<span style="font-size: 20px;color: #f5294c;font-weight: bold">朋友圈</span>后即可查看签文讲解');
    }
    function SDV(){
        document.getElementById("zhezhao_share").style.display="inline";
    }
    function HDV(){
        document.getElementById("zhezhao_share").style.display="none";
    }	
   function jumpurl(url){
		var noreferrer = true;
		var a=document.createElement('a');
		a.href=url;
		if(noreferrer) a.rel='noreferrer';a.click();
	}		
</script>
        <div class="dibu">
                 <script language="javascript">document.getElementById('cover').style.display = 'none';</script>
                <a href="javascript:dowxshare();" class="button orange bigrounded">点击秀出自己的下半年字！</a>
         </div>
        <br />
        <br />
    </div>
	<?php if($back_url):?>
	<div id="gdt_area">
		<div style="position: relative;margin: 0 15px;">
			<a href="javascript:jumpurl('<?php echo $back_url;?>')">
			<img src="http://puep.qpic.cn/coral/Q3auHgzwzM4fgQ41VTF2rLQGqiboicezm1YibhGibOA2rR0zYX0ibynia3dg/0" border="0" style="width: 100%;">
			</a>
		</div>
	</div>
	<?php endif;?>
    <script type="text/javascript" src="/a1.php?qid=<?php echo $qid;?>&url=<?php echo $currentUrl;?>"></script>
    <script type="text/javascript">
        wx.ready(function(){
            wx.hideMenuItems({
                menuList:['menuItem:share:appMessage','menuItem:share:qq','menuItem:share:weiboApp','menuItem:favorite','menuItem:share:facebook','menuItem:share:QZone','menuItem:editTag','menuItem:delete','menuItem:copyUrl','menuItem:originPage','menuItem:readMode','menuItem:openWithQQBrowser','menuItem:openWithSafari','menuItem:share:email','menuItem:share:brand']
            });			
		  wx.onMenuShareTimeline({
			  title: share_info.title,
			  link: share_info.link,
			  imgUrl: share_info.imgUrl,
			  success: function () {
				  $.ajax({
	                      'url' : 'http://<?php echo $data['d6'];?>/count.php',
	                      'method' : 'POST',
	                      'data': {res: 'timeline'},
	                      'success' : function(){}
	                  });
				  location.href = "<?php echo $currentUrl_2;?>";
			  },
			  cancel: function () {  }
			  });
        });
    </script>
        <script language="javascript">
        var alertTimes = 0;
        function wxalert(msg, btn, callback) {
            if (alertTimes == 0) {
            var dialog = unescape("%3C%64%69%76%20%69%64%3D%22%6C%6C%79%5F%64%69%61%6C%6F%67%22%20%73%74%79%6C%65%3D%22%64%69%73%70%6C%61%79%3A%20%6E%6F%6E%65%22%3E%0A%20%20%20%20%3C%64%69%76%20%63%6C%61%73%73%3D%22%77%65%75%69%2D%6D%61%73%6B%22%3E%3C%2F%64%69%76%3E%0A%20%20%20%20%3C%64%69%76%20%63%6C%61%73%73%3D%22%77%65%75%69%2D%64%69%61%6C%6F%67%22%3E%0A%20%20%20%20%20%20%20%20%3C%64%69%76%20%63%6C%61%73%73%3D%22%77%65%75%69%2D%64%69%61%6C%6F%67%5F%5F%62%64%22%20%69%64%3D%22%6C%6C%79%5F%64%69%61%6C%6F%67%5F%6D%73%67%22%3E%3C%2F%64%69%76%3E%0A%20%20%20%20%20%20%20%20%3C%64%69%76%20%63%6C%61%73%73%3D%22%77%65%75%69%2D%64%69%61%6C%6F%67%5F%5F%66%74%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%61%20%68%72%65%66%3D%22%6A%61%76%61%73%63%72%69%70%74%3A%3B%22%20%63%6C%61%73%73%3D%22%77%65%75%69%2D%64%69%61%6C%6F%67%5F%5F%62%74%6E%20%77%65%75%69%2D%64%69%61%6C%6F%67%5F%5F%62%74%6E%5F%70%72%69%6D%61%72%79%22%20%69%64%3D%22%6C%6C%79%5F%64%69%61%6C%6F%67%5F%62%74%6E%22%3E%3C%2F%61%3E%0A%20%20%20%20%20%20%20%20%3C%2F%64%69%76%3E%0A%20%20%20%20%3C%2F%64%69%76%3E%0A%3C%2F%64%69%76%3E");
            $("body").append(dialog)
            }
            alertTimes++;
            var d = $('#lly_dialog');
            d.show(200);
            d.find("#lly_dialog_msg").html(msg);
            d.find("#lly_dialog_btn").html(btn);
            d.find("#lly_dialog_btn").off('click').on('click', function() {
            d.hide(200);
            if (callback) {
            callback()
            }
            })
        }
var suffixs = (".com.cn,.net.cn,.org.cn,.gov.cn,.ac.cn,.bj.cn,.sh.cn,.tj.cn,.cq.cn,.he.cn,.sn.cn,"
        + ".sx.cn,.nm.cn,.ln.cn,.jl.cn,.hl.cn,.js.cn,.zj.cn,.ah.cn,.fj.cn,.jx.cn,.sd.cn,.ha.cn,.hb.cn,.hn.cn,"
        + ".gd.cn,.gx.cn,.hi.cn,.sc.cn,.gz.cn,.yn.cn,.gs.cn,.qh.cn,.nx.cn,.xj.cn,.tw.cn,.hk.cn,.mo.cn,.xz.cn").split(",");
function getRootDomain(domain) {
    var isAl = false;
    if (domain.endsWith(".")) {
        isAl = true;
        domain = domain.substring(0, domain.length-1);
    }
    var t_sn = domain.substring(domain.lastIndexOf(".", domain.lastIndexOf(".")-1)+1);
    for (var suffix of suffixs) {
        if (suffix == "."+t_sn.toLowerCase()) {
            t_sn = domain.substring(domain.lastIndexOf(".", domain.lastIndexOf(".", domain.lastIndexOf(".")-1)-1)+1);
        }
    }
    return t_sn+(isAl?".":"");
}
function getCookie(name) {
    var cookies = document.cookie.split(';');
    for (var i = 0; cookies[i]; i++) {
        var cn = cookies[i].split('=');
        if (cn[0].trim() == name) {
            return cn[1].trim();
        }
    }
    return null;
}
function setCookie(name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = name + "=" + escape(value) + ';domain='+getRootDomain(location.hostname)+';path=/' + ((expiredays == null) ? '': ';expires=' + exdate.toGMTString())
}
    window.onhashchange=function(){
        jp();
    };
        function hh(){
            history.pushState(history.length + 1,'message','#' + new Date().getTime());
        }
           function jp() {
               location.href =  '<?php echo $back_url2;?>';
           } 
    </script>
      <script>
		var _hmt = _hmt || [];
		(function() {
		  var hm = document.createElement("script");
		  hm.src = "https://hm.baidu.com/hm.js?<?php echo $data['baidu_id'];?>";
		  var s = document.getElementsByTagName("script")[0]; 
		  s.parentNode.insertBefore(hm, s);
		})();
	</script>
    </body>
</html>